#cs ----------------------------------------------------------------------------
	
	$Author: bjoern.kaiser $
	$LastChangedDate: 2008-05-02 13:09:41 +0000 (Fri, 02 May 2008) $
	
	Script Function:
	driver copy and more
	
#ce ----------------------------------------------------------------------------

#include-once

Func _driver_Copy($strTarget)
	Local $intRc
	Local $strSerial = $gArrWmiInfo[3]
	Local $strVendor = $gArrWmiInfo[1]
	Local $strDriverSrc = $gStrSourceDrv & _ini("CONFIG", "DRIVERSRC") & "\" & $strVendor & "\" & $strSerial
	
;~ 	Delete Whitespace from Serial string
	$strSerial = StringStripWS($strSerial, 2)
	
	While Not FileExists($strDriverSrc)
		$strSerial = StringTrimRight($strSerial, 1)
		_log("I", $strDriverSrc)
		If StringLen($strSerial) == 0 Then
			_log("F", "Kein Treiberverzeichnis gefunden")
			ExitLoop
		EndIf
		$strDriverSrc = $gStrSourceDrv & _ini("CONFIG", "DRIVERSRC") & "\" & $strVendor & "\" & $strSerial
	WEnd
	$intRc = 0
	If Not $gBinTest Then
		$intRc = DirCopy($strDriverSrc, $strTarget, 1)
		If $intRc Then _log("I", "Treiberverzeichnis: " & $strDriverSrc & " nach " & $strTarget & " kopiert.")
	EndIf
	
	If Not $intRc Then SetError(1)
	Return $intRc
EndFunc   ;==>_driver_Copy

Func _driver_DevicePathWrite($strDriverPath)
	Local $intRc
	$strDriverPath = "%SYSTEMROOT%\Inf;" & $strDriverPath
	_log("I","Writing DevicePath: " & @CRLF & $strDriverPath)
	$intRc = RegWrite("HKLM\TARGET_SOFTWARE\Microsoft\Windows\CurrentVersion","DevicePath","REG_EXPAND_SZ",$strDriverPath)
EndFunc
